<?php
require_once '../requires.php';
session_start();

$type = $_GET['type'];
$api = ApiFac::getApi($type);
$api->setClient($_SESSION['access_token']['oauth_token'], $_SESSION['access_token']['oauth_token_secret']);

switch($type) {
	case 'qq':
		$p =array(
			'f' => 0,
			't' => 0,		
			'n' => 5 
		);
		var_dump($api->api('getTimeline', $p));
		break;
		
	case 'sina':
		var_dump($api->api('public_timeline'));
		break;
	
	case 'facebook':
		var_dump($api->api('api', '/me'));
		break;
	case 'twitter':
		var_dump($api->api('get', 'account/verify_credentials'));
		break;
}

echo "<a href=\"".($api->getLogoutUrl() == '' ? 'index.html' : $api->getLogoutUrl())."\">Logout</a>";
?>